Skip to content

feat(sessions): support call disclosure configuration - #13

Merged
a7vinx merged 10 commits into
mainfrom
codex/session-disclosure-options
Nov 13, 2026
Merged

a7vinx merged 10 commits into
mainfrom
codex/session-disclosure-options

Conversation

@a7vinx

@a7vinx a7vinx commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Managed-user sessions need to choose how the agent discloses that it is an AI. sessions.update_config() on the sync and async clients gains ai_disclosure ("disabled", "on_request" or "proactive"), the engine's own values. caller_id is no longer required, and each setting can be updated on its own. None leaves a setting unchanged, as in managed_users.update(). A call with nothing to change, an unknown value, or a non-string value fails before any request. The server decides which user may set which value: managed users get a 400 for ai_disclosure="disabled".

SessionConfig.ai_disclosure exposes the server's effective value as a plain string, so a mode added later still parses, and it is None when an older server omits it. The SDK and HTTP references document the defaults: managed users proactive, Pine test accounts disabled. They also document that settings apply to the next calls, that 503 session_config_push_failed means saved but not delivered while a 500 normally means not saved (if unsure, call get_config() or send the same value again), and that these settings require a server with session disclosure support.

Validation: ruff check src tests passes, and the offline suite (PYTHONPATH=src pytest tests/ --ignore=tests/integration, 317 passed) and git diff --check pass. Live integration tests were not run because they need credentials and spend credits.

Deployment dependency: use these arguments only after the Pine server supports session disclosure settings. On an older server, managed users get a 400 and test accounts may see the setting accepted without effect. This change does not publish a package release.

🤖 Generated with Claude Code

a7vinx and others added 10 commits November 11, 2026 13:32
…y set

Accept ai_disclosure "off" client-side; the server rejects it for managed
users with 400 and allows it for test accounts. Unknown values, None and
non-strings are still refused before any request. Disclosure update tests
now parse a realistic server response instead of the mock's echo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ai_disclosure takes disabled|on_request|proactive and recording_disclosure
takes disabled|proactive, replacing "off" and the boolean. Updates accept
only known strings; SessionConfig reads both as plain strings so a mode
added by the server still parses. Docs describe test-account defaults,
note that older servers may accept these settings without applying them,
and the update_config docstring groups caller ID and disclosures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match the SDK's partial-update convention: None leaves a session setting
unchanged and is not sent, replacing the private sentinel; a call with
nothing to change still raises ValueError before any request. Response
disclosure fields use plain str. Docs note that a 500 means the change was
not saved, and the changelog says caller_id is no longer required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SDK offers ai_disclosure and caller_id only. Remove recording_disclosure
from update_config() and SessionConfig, drop the RecordingDisclosure type,
and remove it from the docs and changelog. SessionConfig still allows extra
fields, so a server response that carries recording_disclosure still parses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ponses

The server still returns recording_disclosure, and SessionConfig allows extra
fields, so it surfaced as an untyped attribute and in model_dump(). Drop the
key before validation so the SDK never exposes it; other extra fields are
unchanged. Also rewrap a paragraph in docs/sdk-api.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…deled

Drop the response filter and its test so the SDK carries no code for
settings it does not offer; SessionConfig keeps main's handling of
extra fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@a7vinx
a7vinx merged commit 96d77dc into main Nov 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant